home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / Grant's CGI Framework 1.0b14 / Interface / Menus / MenuFunc.c < prev    next >
Text File  |  1996-04-08  |  2KB  |  85 lines

  1. /*****
  2.  *
  3.  *    MenuFunc.c
  4.  *
  5.  *    This is a support file for "Grant's CGI Framework".
  6.  *    Please see the license agreement that accompanies the distribution package
  7.  *    for licensing details.
  8.  *
  9.  *    Copyright ©1995,1996 by Grant Neufeld
  10.  *    grant@acm.com
  11.  *    http://arpp.carleton.ca/grant/
  12.  *
  13.  *****/
  14.  
  15. #include "MyConfiguration.h"
  16. #if kCompileWithForeground
  17.  
  18. #include "compiler_stuff.h"
  19. #include "globals.h"
  20.  
  21. #include "MenuApple.h"
  22. #include "MenuFile.h"
  23. #include "MenuEdit.h"
  24. #include "Quit.h"
  25. #include "WindowInt.h"
  26.  
  27. #include "MenuFunc.h"
  28.  
  29.  
  30. /***  FUNCTIONS  ***/
  31.  
  32. /* Handle a menu selection */
  33. void 
  34. doMenu ( long menuResult, short modifiers  )
  35. {
  36.     short    menuID;
  37.     short    itemNumber;
  38.     
  39.     /* determine which menu */
  40.     menuID        = HiWord ( menuResult );
  41.     /* determine which menu item */
  42.     itemNumber    = LoWord ( menuResult );
  43.     
  44.     switch ( menuID ) 
  45.     {
  46.         case kmAppleMenuID :
  47.             doAppleMenu ( itemNumber, modifiers );
  48.             break;
  49.             
  50.         case kmFileMenuID :
  51.             doFileMenu ( itemNumber, modifiers );
  52.             break;
  53.             
  54.         case kmEditMenuID :
  55.             doEditMenu ( itemNumber, modifiers );
  56.             break;
  57.     }
  58.     
  59.     HiliteMenu ( nil );
  60.     
  61.     /* reset 'quit on idle time' timer */
  62.     ResetQuitIdleTimer();
  63. } /* doMenu */
  64.  
  65.  
  66. /*  */
  67. void
  68. adjustMenus ( void )
  69. {
  70.     WindowPtr        theWindow;
  71.     window_type        theWindowType;
  72.     
  73.     theWindow        = FrontWindow ();
  74.     theWindowType    = WindowType  ( theWindow );
  75.     
  76.     adjustAppleMenu    ( theWindowType );
  77.     adjustFileMenu    ( theWindowType );
  78.     adjustEditMenu    ( theWindowType );
  79. } /* MenusAdjust */
  80.  
  81.  
  82. #endif    /* kCompileWithForeground */
  83.  
  84. /*****  EOF  *****/
  85.